<div class="<%= stats_container_class(@conn) %>" data-site-domain="<%= @site.domain %>">
  <%= if @offer_email_report do %>
    <div class="w-full px-4 text-sm font-bold text-center text-blue-900 bg-blue-200 rounded transition" style="top: 91px" role="alert">
      <%= link("Click here to enable weekly email reports →", to: "/#{URI.encode_www_form(@site.domain)}/settings/email-reports", class: "py-2 block") %>
    </div>
  <% end %>

  <%= if @site.locked do %>
    <div class="w-full px-4 py-4 text-sm font-bold text-center text-yellow-800 bg-yellow-100 rounded transition" style="top: 91px" role="alert">
      <p>This dashboard is actually locked. You are viewing it with super-admin access</p>
    </div>
  <% end %>

  <div class="pt-6"></div>
  <div
    id="stats-react-container"
    style="overflow-anchor: none;"
    data-domain="<%= @site.domain %>"
    data-offset="<%= Plausible.Site.tz_offset(@site) %>"
    data-has-goals="<%= @has_goals %>"
    data-conversions-enabled="<%= Plausible.Billing.Feature.Goals.enabled?(@site) %>"
    data-funnels-enabled="<%= Plausible.Billing.Feature.Funnels.enabled?(@site) %>"
    data-props-enabled="<%= Plausible.Billing.Feature.Props.enabled?(@site) %>"
    data-funnels="<%= Jason.encode!(@funnels) %>"
    data-has-props="<%= @has_props %>"
    data-logged-in="<%= !!@conn.assigns[:current_user] %>"
    data-stats-begin="<%= @stats_start_date %>"
    data-native-stats-begin="<%= @native_stats_start_date %>"
    data-shared-link-auth="<%= assigns[:shared_link_auth] %>"
    data-embedded="<%= @conn.assigns[:embedded] %>"
    data-background="<%= @conn.assigns[:background] %>"
    data-is-dbip="<%= @is_dbip %>"
    data-current-user-role="<%= @conn.assigns[:current_user_role] %>"
    data-flags="<%= Jason.encode!(@flags) %>"
    data-valid-intervals-by-period="<%= Plausible.Stats.Interval.valid_by_period(site: @site) |> Jason.encode!() %>">
  </div>
  <div id="modal_root"></div>
  <%= if !@conn.assigns[:current_user] && @conn.assigns[:demo] do %>
    <div class="bg-gray-50 dark:bg-gray-850">
      <div class="py-12 lg:py-16 lg:flex lg:items-center lg:justify-between">
        <h2 class="text-3xl font-extrabold tracking-tight text-gray-900 leading-9 sm:text-4xl sm:leading-10 dark:text-gray-100">
          Want these stats for your website?
          <br />
          <span class="text-indigo-600">Start your free trial today.</span>
        </h2>
        <div class="flex mt-8 lg:flex-shrink-0 lg:mt-0">
          <div class="inline-flex shadow rounded-md">
            <a href="/register" class="inline-flex items-center justify-center px-5 py-3 text-base font-medium text-white bg-indigo-600 border border-transparent leading-6 rounded-md hover:bg-indigo-500 focus:outline-none focus:ring transition duration-150 ease-in-out">
              Get started
            </a>
          </div>
          <div class="inline-flex ml-3 shadow rounded-md">
            <a href="/" class="inline-flex items-center justify-center px-5 py-3 text-base font-medium text-indigo-600 bg-white border border-transparent leading-6 rounded-md dark:text-gray-100 dark:bg-gray-800 hover:text-indigo-500 dark:hover:text-indigo-500 focus:outline-none focus:ring transition duration-150 ease-in-out">
              Learn more
            </a>
          </div>
        </div>
      </div>
    </div>
  <% end %>
</div>
